Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connect to NQPTP control socket on localhost #1793

Merged
merged 1 commit into from
Jan 29, 2024

Conversation

klemensn
Copy link

@klemensn klemensn commented Jan 27, 2024

nqptp.c listens on "localhost", but shairport-sync connectes to the wildcard
address 0/0. This apparently works on Linux and FreeBSD, but OpenBSD fails:

$ ktrace shairport-sync -v -u
[...]
         0.000038288 "ptp-utilities.c:243" *fatal error: error sending timing_peer_list to NQPTP
         0.000021868 "shairport.c:1728" emergency exit
$ kdump
[...]
  2319 shairport-sync STRU  struct sockaddr { AF_INET, 0.0.0.0:9000 }
  2319 shairport-sync RET   sendto -1 errno 51 Network is unreachable
[...]

Resolve and connect to "localhost" just like NQPTP does, resulting in
127.0.0.1 or ::1 as socket addresses.

This is required to run when configured --with-airplay-2.
Tested on OpenBSD/amd64 7.4-current with shairport-sync 2.4.3 and nqptp
1.2.5-dev cfa8315 (plus OpenBSD fixes).

I expect Linux and FreeBSD to work as before, but have not tested it.

@mikebrady
Copy link
Owner

Many thanks for this!

Would you be kind enough to make the PR against the development branch? We can merge it quickly there.

nqptp.c listens on "localhost", but shairport-sync connectes to the wildcard
address 0/0.  This apparently works on Linux and FreeBSD, but OpenBSD fails:

```
$ ktrace shairport-sync -v -u
[...]
         0.000038288 "ptp-utilities.c:243" *fatal error: error sending timing_peer_list to NQPTP
         0.000021868 "shairport.c:1728" emergency exit
$ kdump
[...]
  2319 shairport-sync STRU  struct sockaddr { AF_INET, 0.0.0.0:9000 }
  2319 shairport-sync RET   sendto -1 errno 51 Network is unreachable
[...]
```

Resolve and connect to "localhost" just like NQPTP does, resulting in
127.0.0.1 or ::1 as socket addresses.

This is required to run when configured `--with-airplay-2`.
Tested on OpenBSD/amd64 7.4-current with shairport-sync 2.4.3 and nqptp
1.2.5-dev cfa8315 (plus OpenBSD fixes).

I expect Linux and FreeBSD to work as before, but have not tested it.
@klemensn klemensn changed the base branch from master to development January 27, 2024 17:56
@klemensn
Copy link
Author

Many thanks for this!

Would you be kind enough to make the PR against the development branch? We can merge it quickly there.

Done.

@mikebrady mikebrady merged commit 6c6d284 into mikebrady:development Jan 29, 2024
9 checks passed
@mikebrady
Copy link
Owner

Thanks for this work.

@klemensn klemensn deleted the control-socket branch January 30, 2024 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants